package com.seeyon.apps.brwh.manager.impl;

import com.seeyon.apps.brwh.dao.CustomOrgDao;
import com.seeyon.apps.brwh.manager.CustomOrgManager;
import com.seeyon.ctp.common.AppContext;
import com.seeyon.ctp.common.exceptions.BusinessException;
import com.seeyon.ctp.common.log.CtpLogFactory;
import com.seeyon.ctp.organization.bo.V3xOrgUnit;
import com.seeyon.ctp.organization.po.OrgMember;
import org.apache.commons.logging.Log;

import java.util.Date;
import java.util.List;

public class CustomOrgManagerImpl implements CustomOrgManager {

    private static final Log log = CtpLogFactory.getLog(CustomOrgManagerImpl.class);

    private CustomOrgDao customOrgDao = (CustomOrgDao) AppContext.getBean("customOrgDao");

    /**
     * 重写findOrgUnitData方法
     * 根据给定的updateTime参数，调用customOrgDao的findOrgUnitData方法来查找组织单元数据
     * 并将结果以List<V3xOrgUnit>类型返回
     *
     * @param updateTime 更新时间
     * @return 组织单元数据列表
     * @throws BusinessException 业务异常
     */
    @Override
    public List<V3xOrgUnit> findOrgUnitData(Date updateTime) throws BusinessException {
        return customOrgDao.findOrgUnitData(updateTime);
    }


    /**
     * 根据更新时间查找组织成员数据
     *
     * @param updateTime 更新时间
     * @return 组织成员数据列表
     * @throws BusinessException 业务异常
     */
    @Override
    public List<OrgMember> findOrgMemberData(Date updateTime) throws BusinessException {
        return customOrgDao.findOrgMemberData(updateTime);
    }

}
